package com.cn.wanxi.service;

import com.cn.wanxi.model.NavModel;

import java.util.ArrayList;
import java.util.List;

public class NavService {
    /**
     * 得到导航数据
     *
     * @return
     */
    public List<NavModel> getNavList() {
        List<NavModel> list = new ArrayList<>();
        NavModel model = new NavModel();//目的就是为了得到hrefs临时变量
        String[] hrefs = model.getHrefs();
        String[] titles = model.getTitles();
        for (int i = 0; i < hrefs.length; i++) {
            NavModel navModel = new NavModel();//就是为了封装页面导航数据
            navModel.setHref(hrefs[i]);
            navModel.setTitle(titles[i]);
            list.add(navModel);
        }
        return list;
    }
}
